
const snapDao = require('../dao/snapDao');

// 查询
module.exports.findSnap = async function (searchObj, page) {
    return await snapDao.find(searchObj, page);
}
// 查所有
module.exports.findAllSnap = async function () {
    return await snapDao.findAllSnap();
}


// 增加
module.exports.createSnap = async function (snap) {
    return await snapDao.create(snap);
}

// 删
module.exports.removeSnap = async function (id) {
    return await snapDao.remove(id);
}

// 改通过id得数据
module.exports.findSnapById = async function (id) {
    console.log("secsdfsd:", await snapDao.findById(id));
    return await snapDao.findById(id);
}

// 修改
module.exports.updateSnap = async function (id, snap) {
    return await snapDao.update({ _id: id }, snap);
}


// 查order id
module.exports.findByOrderId = async function (orderId) {
    console.log("得order-service:", await snapDao.findByOrderId(orderId));
    return await snapDao.findByOrderId(orderId);
}